Attribute VB_Name = "模块1"
''''''''''''''''''''''''''''''''''
' 匹配300以上的数字，并将数字加上一个值。
''''''''''''''''''''''''''''''''''''
Function priceAdd(price, adition)
    Dim result As String
    Set reg = CreateObject("vbscript.regexp")
    reg.Global = True
    reg.Pattern = "([3-9][0-9]{2,})"    '匹配300以上的数字
    price = "=" & Chr(34) & price & Chr(34)
    result = reg.Replace(price, Chr(34) + Chr(38) & "$1+" & adition & "" & Chr(38) & Chr(34))
    result = Evaluate(result)
    priceAdd = result
End Function


Sub TestPriceAdd()

    Debug.Print (priceAdd("9999 蓝色    6+128G", 50))
End Sub
 
